UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZNi6vEdI8Axcfubjan4u3XaOhFYZpAtq1hLfQAmC0J4=' 
WHERE 
  key_id = '98010272dfac37493fccf47d8666a375c6e0152189d79935b59ce51afeefdbe4' 
  AND (
    token = 'ZNi6vEdI8Axcfubjan4u3XaOhFYZpAtq1hLfQAmC0J4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027