UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O+qZTgiFbUHesBer/5Q36f+521lFebwkI6+TFefDQ1Y='
WHERE
key_id = '2af048076743b2612d8dc0e28984c0621f58880699b2e1496a098759565c5af6'
AND (
token = 'O+qZTgiFbUHesBer/5Q36f+521lFebwkI6+TFefDQ1Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)