UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '39W7DACAQ+ufuDUcS/JUnWGl7S8trpiDVTlZCQuoi7A='
WHERE
key_id = '55c51c598f763e39ba9c2437b105ea75103cd81764ff22ec4085887dc909cc19'
AND (
token = '39W7DACAQ+ufuDUcS/JUnWGl7S8trpiDVTlZCQuoi7A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)