UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MSaLOrrmg0rFZu+jHxCIPNo7Yhh+8WRb2VeTLBbQhbA=' 
WHERE 
  key_id = 'b83c9cb2af36cd1d2b04e143096d8aa831d50699678638a90b8a89e085b7b490' 
  AND (
    token = 'MSaLOrrmg0rFZu+jHxCIPNo7Yhh+8WRb2VeTLBbQhbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039