UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3AeoVTJBJZ6HvUSLxye6I2ntYBNChit+KjxYSpOszNM='
WHERE
key_id = '1fe0e15c6abc7665046f057d0511a2410b7a0aad64e5aa4316c654e233e3b60b'
AND (
token = '3AeoVTJBJZ6HvUSLxye6I2ntYBNChit+KjxYSpOszNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)