UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DN9dl/5bZ7KkViMOlMp3ADyBdnrkbGbKGfGLMrzr29s=' 
WHERE 
  key_id = '2dd6f4b7c13ca9c741530acc40ddd013487512073bb8576494ba60b05c84e25a' 
  AND (
    token = 'DN9dl/5bZ7KkViMOlMp3ADyBdnrkbGbKGfGLMrzr29s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028