UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X/4tfoH5YtbbxzI7B/tx7XH8/4W7jqte7ui20HWEhQQ='
WHERE
key_id = '550eae68170d300beaa2fd1259a8f7e0dfc46b7c80c7c17d2f10abe12f5f009d'
AND (
token = 'X/4tfoH5YtbbxzI7B/tx7XH8/4W7jqte7ui20HWEhQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)