UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T1+X3u8Ir2udGiRpTujS/UOEOSlheXWlM9sj4jcUJgs='
WHERE
key_id = 'aeadc3fff5342bd32eccb66731d6ebaa3e9037e72df080e33d582252b46abbaa'
AND (
token = 'T1+X3u8Ir2udGiRpTujS/UOEOSlheXWlM9sj4jcUJgs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)