UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Po2YpIblGNtcAM3CY7QxQd/TmOFN6PgGTG/NMmA5zA0='
WHERE
key_id = '6e999b537284366df7e171fa47853ac5b55ae8a1e93b869acde3c7e88b3169cd'
AND (
token = 'Po2YpIblGNtcAM3CY7QxQd/TmOFN6PgGTG/NMmA5zA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)