UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6csETEptHzk9FWXdz2H4pcg2f5jTyWnYoazXMr/RAL0=' 
WHERE 
  key_id = '1eb9cd5252f24f7d15d9a3ec6b9508736ec50eeccb926a9eb67b055a039ae7c2' 
  AND (
    token = '6csETEptHzk9FWXdz2H4pcg2f5jTyWnYoazXMr/RAL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035