UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sVhLXGPeNf0+eLyBjvMyfutCqUXYkMlpI0kSBIcuWbE=' 
WHERE 
  key_id = 'c2abacd149954b8df48969ad1a603875304aea0fc3e3f5106190f4eb7938165e' 
  AND (
    token = 'sVhLXGPeNf0+eLyBjvMyfutCqUXYkMlpI0kSBIcuWbE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031