UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oo8h3JOkf5JchH+QxPJiwJffddB5cEtidZdUBwDxzN4=' 
WHERE 
  key_id = '80188915ff2d8c1b4f61b28d453e7cc3450b0b6d3287e0d44cefe2e2fa4a9fa6' 
  AND (
    token = 'Oo8h3JOkf5JchH+QxPJiwJffddB5cEtidZdUBwDxzN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028