UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2SRbzdx6YxSjGXBKZ8aC8KrEfxnkZ2XpEJUJ713HaC0='
WHERE
key_id = 'b91dd1fa149aa36c249f5083a033e1c0088ebcfd57f90b7ea2f8e230984a6558'
AND (
token = '2SRbzdx6YxSjGXBKZ8aC8KrEfxnkZ2XpEJUJ713HaC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)