UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8FfP64Sf/YeJCFTP60lvpCivLPz/ZImCmRmZ1GnoysU='
WHERE
key_id = '49c85771a03aacee69042cf298e638f0a3f709e65ed07136593a51d6e6239cd0'
AND (
token = '8FfP64Sf/YeJCFTP60lvpCivLPz/ZImCmRmZ1GnoysU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)