UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tC6wiKdC2qSiWJUgKf6dZeGqsa2zUBnA6osIcc9HvQw='
WHERE
key_id = '5ce80c59a6ef854c798d80c5cdadb8ff66f8d4c0244145f724bbc31344761444'
AND (
token = 'tC6wiKdC2qSiWJUgKf6dZeGqsa2zUBnA6osIcc9HvQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)