UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pl4v8LgKvh7i411jPBdKXy7b6f4C5LHYludcdnMEQ0M=' 
WHERE 
  key_id = '78bfde8972cbd1c03f72d85c4c88490fa8c6121bb6c8eaf2c1f838baac323db6' 
  AND (
    token = 'pl4v8LgKvh7i411jPBdKXy7b6f4C5LHYludcdnMEQ0M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017