UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oOwTNs1t6Udtn9nLeayKG86hiTVDHy9kjLd1JJBnCOE=' 
WHERE 
  key_id = '5a88263d9ca9b654e6c4857cbb9edfe5cb454128f23c95355419a5b17e2ca7c6' 
  AND (
    token = 'oOwTNs1t6Udtn9nLeayKG86hiTVDHy9kjLd1JJBnCOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030