UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DRdYilIHAOc7zTow7vKFC5plVd2I8eB/odRBdG76NKA='
WHERE
key_id = 'ab8defb30a160b5b59bb37e30f03157a92a78cc743b6f5f91c9dbad38591a9b7'
AND (
token = 'DRdYilIHAOc7zTow7vKFC5plVd2I8eB/odRBdG76NKA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)