UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uYXLNDl+jtPDmkar78SOUoVPe/hX4fUcamx19pYNdKY='
WHERE
key_id = '8626ba4e945318b9cdd445d6f38afea14a6a33eecfb9e4ef7a4fcb6794818385'
AND (
token = 'uYXLNDl+jtPDmkar78SOUoVPe/hX4fUcamx19pYNdKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)