UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4j11ZtLVWMkvuVQE32XGRU+DOjlzR7a96ae8KtPj6D0=' 
WHERE 
  key_id = '8d1b84a96ea7a8a721d7800eb8f56291bf663b07e96b6717d146a03e4a3938b8' 
  AND (
    token = '4j11ZtLVWMkvuVQE32XGRU+DOjlzR7a96ae8KtPj6D0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030