UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AJGlhBaO92jZFgjjJ+VEflJlZpZN+IfBEYxcMdE7CgU=' 
WHERE 
  key_id = '848c82289298188ef0ca92af72433486a3a1d39c6102a34cc5cdb94da1d28db0' 
  AND (
    token = 'AJGlhBaO92jZFgjjJ+VEflJlZpZN+IfBEYxcMdE7CgU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019