UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '63wttGv4G8hdcm6tyYTOAguyjtd6JS/286efeeor570='
WHERE
key_id = 'f2a50e2e203200ce1029748f2774384c1fe9ff2c3988b634322e87a2fe0c6d31'
AND (
token = '63wttGv4G8hdcm6tyYTOAguyjtd6JS/286efeeor570='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)