UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KUnrEx4Q40qFuDxxNQ3Va9WKWJP8UkWHXPgE9tCtjBU=' 
WHERE 
  key_id = '15079336a9fac3650513a4ab0ebe72049c1a1275b4f5f48da2ead4d23cde0af8' 
  AND (
    token = 'KUnrEx4Q40qFuDxxNQ3Va9WKWJP8UkWHXPgE9tCtjBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033