UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SSmXo4ckN4+EdPu9xh6T/2gHpqGyUrA9bqV9lRdRmMo='
WHERE
key_id = 'de86d266fa3915358017e1b7a01f1d8e5c394d8635c3b66c8a228b78c1791348'
AND (
token = 'SSmXo4ckN4+EdPu9xh6T/2gHpqGyUrA9bqV9lRdRmMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)