UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'siAnQ6yz1DjNVwN87ZxQVycdnJ5NQPIuuNz4EhQsdC4=' 
WHERE 
  key_id = '124d1f96fcf0c905332ec7e1745564417648fe78b74b537c41bb0b496ef9dd99' 
  AND (
    token = 'siAnQ6yz1DjNVwN87ZxQVycdnJ5NQPIuuNz4EhQsdC4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029