UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'skqSpzpyPvEapr7Rb2UqslUzTP5t/bU5vnYqhDvy6AM='
WHERE
key_id = 'f7ffc65fcf3b03484e1f64d8db9663dd2e6aab5fe0a5e4536fa8442552ba1a25'
AND (
token = 'skqSpzpyPvEapr7Rb2UqslUzTP5t/bU5vnYqhDvy6AM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)