UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z+ccQQa3QV56aneF74+zILV/dF0NR6WPO0Sc9uYYeg8='
WHERE
key_id = '97e39a4956a4c9017a637058823e883d0bf209fcd7c610bee37bbfa9fbb68f1a'
AND (
token = 'Z+ccQQa3QV56aneF74+zILV/dF0NR6WPO0Sc9uYYeg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)