UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SYDL+YJ1saxiC21DZil8qF2OoIUWeNjHwUzWP1d/GcY='
WHERE
key_id = 'e9fc291b4ee7de32687d382957996a4de9831504df1269cbbae1612bc0cba0d4'
AND (
token = 'SYDL+YJ1saxiC21DZil8qF2OoIUWeNjHwUzWP1d/GcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)