UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8/i5G36tE9rmMtFOVfQlOvTb/D0qb/+5oTikPbbjfdo=' 
WHERE 
  key_id = '9d8f7b65492d58398c08132add5a20f24e0f774c48ae1e9e1ca8ec91f3be18a9' 
  AND (
    token = '8/i5G36tE9rmMtFOVfQlOvTb/D0qb/+5oTikPbbjfdo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034