UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WsuQBCVytWidDIwuTEEZl24Hjg2NysfbbRpuj/eTm4c='
WHERE
key_id = 'c187f59938ff2157d9cc21c0c8588ef4f8186dc80d0cae06089b1b800f703251'
AND (
token = 'WsuQBCVytWidDIwuTEEZl24Hjg2NysfbbRpuj/eTm4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)