UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mjg2w6s1k8yJO/ae2dDkKEsGfd5qr8ZarDOJm/6CMNU=' 
WHERE 
  key_id = 'f6e026d7168b3a14e67586de6ed5c229be18e193e4f551ae4f3aee52e3b2a7f6' 
  AND (
    token = 'mjg2w6s1k8yJO/ae2dDkKEsGfd5qr8ZarDOJm/6CMNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042