UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4WifJZoOTDql5xqt4S9R3+Qg+NHr7rXJefsUHxNKlEI=' 
WHERE 
  key_id = 'c9cf50aa860a1430c2ba16e22959321b73a896ff363904e36b24550bd52b7e73' 
  AND (
    token = '4WifJZoOTDql5xqt4S9R3+Qg+NHr7rXJefsUHxNKlEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033