UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zbLmTBUXrZ2vRCdJciTrhpPyPX1MYV3hW5hX0iSFtQc='
WHERE
key_id = 'c93d8c14f1d1a31c39cc3af9f66c397701f8b6f1d366fe9b5976807ab94d668f'
AND (
token = 'zbLmTBUXrZ2vRCdJciTrhpPyPX1MYV3hW5hX0iSFtQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)