UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uxsmc61CUdm6pBic95IVbRpdOeaW+JPqIlmCKM0qL/U='
WHERE
key_id = '838d1c28173e2b09105c183872f6713d116dfd3d4a13d1e10bbf0e58d84dc4b9'
AND (
token = 'uxsmc61CUdm6pBic95IVbRpdOeaW+JPqIlmCKM0qL/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)