UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '534nfVeecn3T2lj21P2JaSr+9grO3jrsjkfIV4Sjh34=' 
WHERE 
  key_id = '30a2818618e491626123b08efe1cfa41ae2e683218aa97cf5da580ce81e1b72b' 
  AND (
    token = '534nfVeecn3T2lj21P2JaSr+9grO3jrsjkfIV4Sjh34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020