UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9CqB8SNo+0U8SsjY+1ESuf1jVuirYCYDUejNcsOcbjU=' 
WHERE 
  key_id = 'e0d1a61aa19e14bbeb20fb58b9451674e2e1041adc0c4f1835fac3e6d36381ff' 
  AND (
    token = '9CqB8SNo+0U8SsjY+1ESuf1jVuirYCYDUejNcsOcbjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052