UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RTCKetLMkKoWY+nJM/ewvMyOXQf8cVmwtoFC4KbXWec='
WHERE
key_id = 'ac1a67d037efa97d84ede5e056c8d756ccc1e4e2ebceea5b6ac91fc0e061b5d0'
AND (
token = 'RTCKetLMkKoWY+nJM/ewvMyOXQf8cVmwtoFC4KbXWec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)