UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'baLqM4n+ILJuVYu0V5Y8voBoRO1ia8QzArOvufHzFuI=' 
WHERE 
  key_id = '72c3c759e17240b0984ecae39339b68a1e51882a9a7546c7b6422c4fa26bb12e' 
  AND (
    token = 'baLqM4n+ILJuVYu0V5Y8voBoRO1ia8QzArOvufHzFuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035