UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qlY6d0Fk7Ebg61yI/iZoqvM5YVRBr1te9K75Bh3+HNs=' 
WHERE 
  key_id = '79887e1736a9a2ffd087ecd9a893b382cf9710a22f509f6ea4bd1bceeed3355d' 
  AND (
    token = 'qlY6d0Fk7Ebg61yI/iZoqvM5YVRBr1te9K75Bh3+HNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028