UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JBsRcr6mdvipuxfCfvgshlzqdY2y/23Avz/6oPzOnJE='
WHERE
key_id = '121f157ef53c62fbbc82e181c0442312caa18dd3ca852e1daeacfe22ca65fa05'
AND (
token = 'JBsRcr6mdvipuxfCfvgshlzqdY2y/23Avz/6oPzOnJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)