UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mys/P9DpKXEyAzTMPUwotrz2/3ESNvOyDLvKa73bCKk='
WHERE
key_id = '0ec7ea5e32504bf374979c883fb567d0820e0ed2ea4ae04541e27257e27ce202'
AND (
token = 'Mys/P9DpKXEyAzTMPUwotrz2/3ESNvOyDLvKa73bCKk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)