UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eKyUp/JHgGCkEe5rWRCGIVTsrmbIvdaJChhphyFBCB0='
WHERE
key_id = 'fb586ba79b051ce5e88b763e224796bc36a7595f895e8bf53a736a20b6cb3daa'
AND (
token = 'eKyUp/JHgGCkEe5rWRCGIVTsrmbIvdaJChhphyFBCB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)