UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vmcdbNVxdJ0WLMuakEBd2BOQTpjf5lBmlMHt8jgY+rA=' 
WHERE 
  key_id = 'bb054c1be765b52bc9ed509dd2644c6dc791bb6a6e49bba231c5cf7d88f9ddfa' 
  AND (
    token = 'vmcdbNVxdJ0WLMuakEBd2BOQTpjf5lBmlMHt8jgY+rA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037