UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cOwqC+ofuJBgPNb7jsOKk/FVWW6HM9AiJDCAucp48es=' 
WHERE 
  key_id = '80a958bb77eb9ce2c8fcd71e4685cd4c34c23d890ce195718f11c32b55e86bd0' 
  AND (
    token = 'cOwqC+ofuJBgPNb7jsOKk/FVWW6HM9AiJDCAucp48es=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00126