UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MIr1yLA4z/zsdXW/XKhPZLl9rJj8T3H2uz+joWmhN7k='
WHERE
key_id = '57f4da3f576ac873e2e49f0e36da4acc7fb8bfd907cebf968e9ffd7025088a33'
AND (
token = 'MIr1yLA4z/zsdXW/XKhPZLl9rJj8T3H2uz+joWmhN7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)